import EnumNumVO from '@/model/base/EnumNumVO'

// 大小写
export default class DelSpecialEnum {
    static readonly not_do: string = '不操作'
    static readonly cr: string = '回车(CR)'
    static readonly lf: string = '换行(LF)'
    static readonly cr_lf: string = '回车换行（CR LF）'
    static readonly tab: string = '水平制表（TAB）'
    static readonly blank: string = '空格'

    private static readonly NOT_DO: EnumNumVO = new EnumNumVO(0, DelSpecialEnum.not_do)
    private static readonly CR: EnumNumVO = new EnumNumVO(1, DelSpecialEnum.cr)
    private static readonly LF: EnumNumVO = new EnumNumVO(2, DelSpecialEnum.lf)
    private static readonly CR_LF: EnumNumVO = new EnumNumVO(3, DelSpecialEnum.cr_lf)
    private static readonly TAB: EnumNumVO = new EnumNumVO(4, DelSpecialEnum.tab)
    private static readonly BLANK: EnumNumVO = new EnumNumVO(5, DelSpecialEnum.blank)

    static readonly enums: EnumNumVO[] = [
      DelSpecialEnum.NOT_DO,
      DelSpecialEnum.CR,
      DelSpecialEnum.LF,
      DelSpecialEnum.CR_LF,
      DelSpecialEnum.TAB,
      DelSpecialEnum.BLANK
    ]

    static readonly enum_map: Map<number, string> = new Map<number, string>()

    static getTypeName(value: number) {
      return DelSpecialEnum.enum_map.get(value)
    }
}

DelSpecialEnum.enums.forEach((item) => {
  DelSpecialEnum.enum_map.set(item.value, item.name)
})

